from django.urls import path
from .views import (
    TreeTemplateCategoriesView, CreateTemplateCategoryView, GetCategoryDetailView, UpdateTemplateCategoryView,
    DeleteTemplateCategoryView, TemplateListView, CreateTemplateView, UpdateTemplateView, BatchDeleteTemplatesView,
    UseTemplateView
)

# 分类管理
urlpatterns = [
    path('categories/', TreeTemplateCategoriesView.as_view(), name='category-tree'),
    path('categories/create/', CreateTemplateCategoryView.as_view(), name='category-create'),
    path('categories/detail/<str:category_id>/', GetCategoryDetailView.as_view(), name='category-detail'),
    path('categories/update/<str:category_id>/', UpdateTemplateCategoryView.as_view(), name='category-update'),
    path('categories/delete/<str:category_id>/', DeleteTemplateCategoryView.as_view(), name='category-delete'),
]
# 模板管理
urlpatterns += [
    path('templates/', TemplateListView.as_view(), name='template-list'),
    path('templates/create/', CreateTemplateView.as_view(), name='template-create'),
    path('templates/update/<str:template_id>/', UpdateTemplateView.as_view(), name='template-update'),
    path('templates/delete/', BatchDeleteTemplatesView.as_view(), name='template-batch-delete'),
    path('templates/use/<str:template_id>/', UseTemplateView.as_view(), name='template-use'),
]
